chrome.app.runtime.onLaunched.addListener(function() {
  chrome.app.window.create('main.html', {
    minWidth: 320,
    minHeight: 400,
    bounds: {
      top: 20,
      left: 20,
      width: 650,
      height: 480
    }
  }, function(app) {
    console.log("launched");
    app.onClosed.addListener(function() {
      console.log("onClosed", app);
      /*chrome.serial.close(conn_id);*/

    });
  });

});

chrome.runtime.onInstalled.addListener(function() { 
  console.log("installed");
});
chrome.runtime.onSuspend.addListener(function() { 
  console.log("suspend");
});

